package com.mondo.financialwallet.presentation.ui.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mondo.financialwallet.R;
import com.mondo.financialwallet.presentation.model.FinancialAssetRecord;
import com.mondo.financialwallet.presentation.model.FinancialOrderList;

import java.util.Collections;
import java.util.List;

// TODO 中文
public class FinancialAssetRecordAdapter extends BaseQuickAdapter<FinancialAssetRecord, BaseViewHolder> {

    public static FinancialAssetRecordAdapter create(String total, String yesterday){
        return new FinancialAssetRecordAdapter(
                R.layout.item_financial_asset_record,
                Collections.singletonList(
                        new FinancialAssetRecord("定期理财($)", total, yesterday)
                )
        );
    }


    private FinancialAssetRecordAdapter(int layoutResId, @Nullable List<FinancialAssetRecord> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, FinancialAssetRecord item) {
        helper.setText(R.id.name_text_view, item.getName());
        helper.setText(R.id.total_income_text, item.getIncome());
        helper.setText(R.id.yesterday_earnings_text, item.getYesterdayEarnings());
    }
}
